import type { AxiosRequestConfig, AxiosResponse } from 'axios'

// 定义拦截器接口
export interface WmcRequestInterceptors<T = AxiosResponse> {
  requestInterceptors?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptors?: (res: T) => T
  responseInterceptorCatch?: (error: any) => any
}

// 对 AxiosRequestConfig 扩展 拦截器属性，使用WmcRequestConfig代替AxiosRequestConfig
export interface WmcRequestConfig<T = AxiosResponse>
  extends AxiosRequestConfig {
  interceptors?: WmcRequestInterceptors<T>
  showLoading?: boolean
}
